#!/bin/sh

export TEXTDOMAIN=frisbee
export OUTPUT_CHARSET=UTF-8
. gettext.sh

PPPDPID=$(cat /var/run/ppp-gprs.pid)
if [ "$PPPDPID" ];then
	CONNECTEDDEV="$(busybox ps | grep "^ *$PPPDPID" | grep 'pppd' | grep -v 'grep' | grep -o '/dev/[a-z][^ ]*')"
#echo "frisbee-gprs-disconnect - PPPDPID: $PPPDPID  CONNECTEDDEV: $CONNECTEDDEV  " >> /tmp/debug.log  #DEBUG
	if [ "$CONNECTEDDEV" ];then
		kill $PPPDPID
		rm -f /var/run/ppp-gprs.pid
		gtkdialog-splash -timeout 15 -placement center -bg orange -text "$(eval_gettext "Mobile device \\\$CONNECTEDDEV disconnected")"
	fi
fi
exit 0
